from typing import Annotated

from fastapi import APIRouter, Depends
from loguru import logger
from starlette.requests import Request
from src.config.auth import auth_depend
from src.config.log import log_depend, log_user_id

# router = APIRouter(dependencies=[Depends(auth_depend), Depends(log_depend)], tags=["首页"])
router = APIRouter(tags=["首页"])


# @router.get("/", status_code=200, summary="index请求", dependencies=[Depends(auth_depend), Depends(log_depend)])
# async def root(request: Request, _=Depends(auth_depend), ):
#     logger.bind(user_id=log_user_id.get()).info(f" 进入首页")
#     return {"message": f"Hello World!!!,,{request.state.login_user}"}


# @router.get("/", status_code=200, summary="index请求", )
# async def root(request: Request, auth_check: Annotated[None, Depends(auth_depend)],
#                log_handler: Annotated[None, Depends(log_depend)]):
#     logger.bind(user_id=log_user_id.get()).info(f" 进入首页")
#     return {"message": f"Hello World!!!,,{request.state.login_user}"}

@router.get("/", status_code=200, summary="index请求", )
async def root():
    return {"message": f"Hello World"}
